package com.twu.biblioteca;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: kush jain
 * Date: 7/5/13
 * Time: 12:17 AM
 * To change this template use File | Settings | File Templates.
 */
public class User implements Serializable {
    private String name = new String();
    private String password= new String();
    private String email= new String();
    private String phoneNo= new String();



    private String username= new String();
    public String getName() {
        return name;
    }

    User(){}
    User(String username,String password,String name,String email,String phoneNo) {
        this.username=username;
        this.password=password;
        this.email=email;
        this.phoneNo=phoneNo;
        this.name=name;
    }

    public String getUsername() {
        return username;
    }

    public boolean matchLoginData(String username,String password){
        if(this.username.equals(username) && this.password.equals(password))
            return true;

        return false;
    }
    public String print()
    {
        String userInfo = "";
        userInfo += "Library Number:" + Presenter.seperator + username + Presenter.newLine;
        userInfo += "Name:" + Presenter.seperator + name + Presenter.newLine;
        userInfo += "E-Mail:" + Presenter.seperator + email + Presenter.newLine;
        userInfo += "Phone Number:" + Presenter.seperator + phoneNo + Presenter.newLine;
        return userInfo;
    }

    public void read()
    {
        username = Presenter.getInput("Enter the Library Card Number:");
        name = Presenter.getInput("Enter Name:");
        password = Presenter.getInput("Enter New Password");
        email = Presenter.getInput("Enter Email");
        phoneNo = Presenter.getInput("Enter Phone Number");
    }
}
